﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Caching;

namespace Shsc.Net.Common.Seasar.Extension.CustomAttribute
{
    [AttributeUsage(AttributeTargets.Method)]
    public class CacheAttribute : Attribute
    {
        public static Cache Cache;
        /// <summary>
        /// 方法参数
        /// </summary>
        public object[] MethodParam { get; set; }

        /// <summary>
        /// 方法名
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// cacheRule
        /// </summary>
        public CacheRule Expiration { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public double ExpirationTime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public CacheAttribute()
        {
            Expiration = CacheRule.NoExpiration;
        }

    }

    public enum CacheRule
    {
        /// <summary>
        /// 相对时间
        /// </summary>
        NoAbsoluteExpiration,

        /// <summary>
        /// 绝对时间
        /// </summary>
        NoSlidingExpiration,

        /// <summary>
        /// 不过期
        /// </summary>
        NoExpiration
    }
}
